Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZBUG-2608: Contacts not importing references from ContactGroups #1237

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

ronstra-synacor
Copy link
Contributor

Problem:
When importing an exported CSV or TGZ previously exported by Zimbra that has a ContactGroup, CONTACT_REF references are being turned into INLINE, losing any attributes defined for that contact in the imported file.

Fix:
For CSV, inside the ContactGroup class, for each member of the "dlist" field, convert all bare inline addresses that have also been imported in the same file with a reference to that imported contact.
For TGZ, the approach is similar, but it was very difficult to find just where to implement it. Ended up in ArchiveFormatter::postProcessContacts.

Progress:
CSV fix appears to be good. For TGZ, while the contact does go through postProcessContacts, I can't figure out how to save it back to the Zimbra store after converting inline addresses to contact references.

When importing contact groups, members were always added inline. Now, we
pass a map of all other contacts parsed in the same batch, and if one of
them matches an address, that member is stored as a reference instead.
Plus some more informative logging when catching error around adding
members to imported contact group.
@CLAassistant
Copy link

CLAassistant commented Mar 8, 2022

CLA assistant check
All committers have signed the CLA.

@shrutig0510
Copy link
Contributor

Formatting issues... Please fix it to make it more readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants